#ifndef _MISC_H_
#define _MISC_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>

/* Turn this off for a little better performance during benchmarking */
#define ASSERT
#define DEBUG

#ifdef DEBUG 
#define dprintf(fmt, ...) printf("[[%s:%s:%d]]:\t" fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);fflush(stdout)        //works with GCC, but not with other compilers. that's what I read on wikipedia
#else
#define dprintf(fmt, args...)
#endif


/* Error codes */
#define _EMISC      -1      /* Tihs is hardcoded at a few places. Do not change */
#define _ESUCCESS   0
#define _ENOMEM     1
#define _EBADSIZE   2
#define _ENOTIMPL   3

#ifdef __cplusplus
}
#endif

#endif /* _MISC_H_ */
